package com.angis.fx.activity.service;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.widget.Toast;

import com.angis.fx.handler.login.UpdateHandler;

public class CKTypeService extends Service {

	@Override
	public void onCreate() {
		try {
			int flag = UpdateHandler.ckTypeUpdate(CKTypeService.this);
			Thread.sleep(1000);
			if(flag == -1) {
				Toast.makeText(this, "服务器连接错误!", Toast.LENGTH_SHORT).show();
			}else if(flag == 0){
				Toast.makeText(this, "检查更新错误!", Toast.LENGTH_SHORT).show();
			}else if(flag == 1){
				
				Toast.makeText(this, "检查更新完成!", Toast.LENGTH_SHORT).show();
			}
		} catch (InterruptedException e) {} finally {this.stopSelf();}
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
	}

	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}

}
